The phrase "to cook the mushrooms" means to prepare the mushrooms by heating them in a pan or on a stove until they are fully cooked and ready to eat.